/* add.c
 *	Simple program to test whether the systemcall interface works.
 *	
 *	Just do a add syscall that adds two values and returns the result.
 *
 */

#include "syscall.h"

int main(int argc, char * argv[])
{
    int result, i, a, b;
    
    result = Add(42, 23);
    Print( "Add: Haha, I Add 42 to 23. the result is: " );
    PrintNum( result );
    Print( "\n" );
    
    Exec( "print" );
    Print( "Add: Now back to add again \n" );
    Exec( "print" );
    Print( "Add: Now I'll halt the machine.\n" );

    // this is another test
    PrintNum( (int)&argc );
    Print("\n");
    PrintNum( (int)&argv );
    Print("\n");

    Print( "argc = " );
    PrintNum( argc );
    Print("\n");

    i = 0;
    while( i < argc )
    {
        char pArg = argv[i];
        i++;
        Print( pArg );
        Print( "\n" );
    }

    a = 1;
    b = 2;
    Print( "Print finish" );
    Print( "\n" );
  
  /* not reached */
}
